Optimal. Leaf size=31 \[ \frac {x}{a}+\frac {\tanh ^{-1}(\cos (x))}{2 a}+\frac {\cot (x) (2-\csc (x))}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3973, 3966,
3855} \begin {gather*} \frac {x}{a}+\frac {\tanh ^{-1}(\cos (x))}{2 a}+\frac {\cot (x) (2-\csc (x))}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3855
Rule 3966
Rule 3973
Rubi steps
\begin {align*} \int \frac {\cot ^4(x)}{a+a \csc (x)} \, dx &=\frac {\int \cot ^2(x) (-a+a \csc (x)) \, dx}{a^2}\\ &=\frac {\cot (x) (2-\csc (x))}{2 a}-\frac {\int (-2 a+a \csc (x)) \, dx}{2 a^2}\\ &=\frac {x}{a}+\frac {\cot (x) (2-\csc (x))}{2 a}-\frac {\int \csc (x) \, dx}{2 a}\\ &=\frac {x}{a}+\frac {\tanh ^{-1}(\cos (x))}{2 a}+\frac {\cot (x) (2-\csc (x))}{2 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(90\) vs. \(2(31)=62\).
time = 0.04, size = 90, normalized size = 2.90 \begin {gather*} \frac {x}{a}+\frac {\cot \left (\frac {x}{2}\right )}{2 a}-\frac {\csc ^2\left (\frac {x}{2}\right )}{8 a}+\frac {\log \left (\cos \left (\frac {x}{2}\right )\right )}{2 a}-\frac {\log \left (\sin \left (\frac {x}{2}\right )\right )}{2 a}+\frac {\sec ^2\left (\frac {x}{2}\right )}{8 a}-\frac {\tan \left (\frac {x}{2}\right )}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 51, normalized size = 1.65
method | result | size |
default | \(\frac {\frac {\left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}-2 \tan \left (\frac {x}{2}\right )+8 \arctan \left (\tan \left (\frac {x}{2}\right )\right )-\frac {1}{2 \tan \left (\frac {x}{2}\right )^{2}}+\frac {2}{\tan \left (\frac {x}{2}\right )}-2 \ln \left (\tan \left (\frac {x}{2}\right )\right )}{4 a}\) | \(51\) |
risch | \(\frac {x}{a}+\frac {2 i {\mathrm e}^{2 i x}+{\mathrm e}^{3 i x}-2 i+{\mathrm e}^{i x}}{a \left ({\mathrm e}^{2 i x}-1\right )^{2}}+\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{2 a}-\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{2 a}\) | \(67\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 86 vs.
\(2 (25) = 50\).
time = 0.47, size = 86, normalized size = 2.77 \begin {gather*} -\frac {\frac {4 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}}{8 \, a} + \frac {2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} - \frac {\log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{2 \, a} + \frac {{\left (\frac {4 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right )} {\left (\cos \left (x\right ) + 1\right )}^{2}}{8 \, a \sin \left (x\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 64 vs.
\(2 (25) = 50\).
time = 4.48, size = 64, normalized size = 2.06 \begin {gather*} \frac {4 \, x \cos \left (x\right )^{2} + {\left (\cos \left (x\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (\cos \left (x\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - 4 \, \cos \left (x\right ) \sin \left (x\right ) - 4 \, x + 2 \, \cos \left (x\right )}{4 \, {\left (a \cos \left (x\right )^{2} - a\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\cot ^{4}{\left (x \right )}}{\csc {\left (x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 65 vs.
\(2 (25) = 50\).
time = 0.42, size = 65, normalized size = 2.10 \begin {gather*} \frac {x}{a} - \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{2 \, a} + \frac {a \tan \left (\frac {1}{2} \, x\right )^{2} - 4 \, a \tan \left (\frac {1}{2} \, x\right )}{8 \, a^{2}} + \frac {6 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 4 \, \tan \left (\frac {1}{2} \, x\right ) - 1}{8 \, a \tan \left (\frac {1}{2} \, x\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.30, size = 85, normalized size = 2.74 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{8\,a}-\frac {2\,\mathrm {atan}\left (\frac {4}{4\,\mathrm {tan}\left (\frac {x}{2}\right )+2}-\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{4\,\mathrm {tan}\left (\frac {x}{2}\right )+2}\right )}{a}-\frac {\mathrm {tan}\left (\frac {x}{2}\right )}{2\,a}-\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{2\,a}+\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )-\frac {1}{2}}{4\,a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________